{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<!--数据列表页面-->
<section class="content">

    <!--顶部搜索筛选-->
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-body">
                    <form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">

                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$member_id ? $member_id : '' ;}"
                                   name="member_id" id="member_id" class="form-control input-sm"
                                   placeholder="用户融云ID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$me_uid ? $me_uid : '' ;}"
                                   name="me_uid" id="me_uid" class="form-control input-sm"
                                   placeholder="用户UID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$me_phone ? $me_phone : '' ;}"
                                   name="me_phone" id="me_phone" class="form-control input-sm"
                                   placeholder="用户手机号搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$me_nick_name ? $me_nick_name : '' ;}"
                                   name="me_nick_name" id="me_nick_name" class="form-control input-sm"
                                   placeholder="用户昵称搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="me_is_vip" id="me_is_vip" class="form-control input-sm index-search">
                                <option value="">-VIP开通方式-</option>
                                <option value="1"{if isset($me_is_vip) && $me_is_vip=='1'}selected{/if}>自行开通</option>
                                <option value="2"{if isset($me_is_vip) && $me_is_vip=='2'}selected{/if}>后台开通</option>
                                <option value="0"{if isset($me_is_vip) && $me_is_vip=='0'}selected{/if}>未开通</option>
                            </select>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="me_sex" id="me_sex" class="form-control input-sm index-search">
                                <option value="">-性别-</option>
                                <option value="1"{if isset($me_sex) && $me_sex=='1'}selected{/if}>男</option>
                                <option value="2"{if isset($me_sex) && $me_sex=='2'}selected{/if}>女</option>
                            </select>
                        </div>

                        <br>

                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$fmember_id ? $fmember_id : '' ;}"
                                   name="fmember_id" id="fmember_id" class="form-control input-sm"
                                   placeholder="上级用户融云ID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$fme_uid ? $fme_uid : '' ;}"
                                   name="fme_uid" id="fme_uid" class="form-control input-sm"
                                   placeholder="上级用户UID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$fme_phone ? $fme_phone : '' ;}"
                                   name="fme_phone" id="fme_phone" class="form-control input-sm"
                                   placeholder="上级用户手机号搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$fme_nick_name ? $fme_nick_name : '' ;}"
                                   name="fme_nick_name" id="fme_nick_name" class="form-control input-sm"
                                   placeholder="上级用户昵称搜索">
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
                            </button>
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
                                    class="fa  fa-eraser"></i> 清空查询
                            </button>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <b>【自行开通：{$zxktvip}人】</b>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <b>【后台开通：{$htktvip}人】</b>
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <b>【未开通：{$wkktvip}人】</b>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="box">

                <!--数据列表顶部-->
                <div class="box-header">
                    <div>
                        <a class="btn btn-success btn-sm ReloadButton" data-toggle="tooltip" title="刷新">
                            <i class="fa fa-refresh"></i> 刷新
                        </a>
                    </div>
                </div>

                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered datatable" width="100%">
                        <thead>
                        <tr style="white-space: nowrap">
                            <th style="text-align: center;vertical-align: middle;">用户信息</th>
                            <th style="text-align: center;vertical-align: middle;">性别</th>
                            <th style="text-align: center;vertical-align: middle;">注册时间</th>
                            <th style="text-align: center;vertical-align: middle;">状态</th>
                            <th style="text-align: center;vertical-align: middle;">上级融云ID(UID)(昵称)</th>
                            <th style="text-align: center;vertical-align: middle;">绑定方式</th>
                            <th style="text-align: center;vertical-align: middle;">绑定时间</th>
<!--                            <th style="text-align: center;vertical-align: middle;">VIP</th>-->
                            <th style="text-align: center;vertical-align: middle;">VIP开通方式</th>
                            <th style="text-align: center;vertical-align: middle;">开通渠道</th>
                            <th style="text-align: center;vertical-align: middle;">开通时间</th>

                            <th style="text-align: center;vertical-align: middle;">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name='data' id='item' key='data_key'}
                        <tr>
                            <td style="text-align: center;vertical-align: middle;">【融云ID：{$item.member_id}】【UID：{$item.me_uid}】【昵称：{$item.me_nick_name}】【手机号：{$item.me_phone}】</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.me_sex_word}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.me_add_time}</td>
                            {if $item.me_status==1}
                            <td style="text-align: center;vertical-align: middle;color: green">{$item.me_status_word}
                            </td>
                            {/if}
                            {if $item.me_status==2}
                            <td style="text-align: center;vertical-align: middle;color: red">{$item.me_status_word}
                            </td>
                            {/if}
                            {if $item.me_status==99}
                            <td style="text-align: center;vertical-align: middle;color: red">已注销
                            </td>
                            {/if}

                            <td style="text-align: center;vertical-align: middle;">{$item.me_parent_word}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.me_bind_type_word}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.me_bind_time_word}</td>

<!--                            <td style="text-align: center;vertical-align: middle;">{$item.me_is_vip_word}</td>-->

                            <td style="text-align: center;vertical-align: middle;">{$item.vip_order_word}</td>

                            <td style="text-align: center;vertical-align: middle;">{$item.is_song_word}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.k_add_time}</td>

                            <td style="text-align: center;vertical-align: middle;">
                                {if $item.is_button == 1}
                                    {if $item.me_is_vip == 0}
                                        <a class="btn btn-success btn-xs AjaxButton" data-toggle="tooltip" title="直接开通VIP权益"
                                           data-id="{$item.member_id}" data-confirm-title="开通VIP权益确认"
                                           data-confirm-content='您确定为融云ID为 <span class="text-red">{$item.member_id}</span> 的用户直接【开通VIP权益】吗？'
                                           data-url="{:url('openvip')}">
                                            打开VIP
                                        </a>
                                    {else/}
                                        <a class="btn btn-danger btn-xs AjaxButton" data-toggle="tooltip" title="直接取消VIP权益"
                                           data-id="{$item.member_id}" data-confirm-title="取消VIP权益确认"
                                           data-confirm-content='您确定关闭融云ID为 <span class="text-red">{$item.member_id}</span> 的用户【VIP权益】吗？'
                                           data-url="{:url('shutvip')}">
                                            关闭VIP
                                        </a>
                                    {/if}
                                {else/}
                                    -
                                {/if}
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>

                <!-- 数据列表底部 -->
                <div class="box-footer">
                    {$page|raw}
                    <label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
                        <small>共{$total}条记录</small>&nbsp;
                        <small>每页显示</small>
                        &nbsp;
                        <select class="input-sm" onchange="changePerPage(this)">
                            <option value="10" {if $admin.per_page==10}selected{/if}>10</option>
                            <option value="20" {if $admin.per_page==20}selected{/if}>20</option>
                            <option value="30" {if $admin.per_page==30}selected{/if}>30</option>
                            <option value="50" {if $admin.per_page==50}selected{/if}>50</option>
                            <option value="100" {if $admin.per_page==100}selected{/if}>100</option>
                        </select>
                        &nbsp;
                        <small>条记录</small>
                    </label>
                </div>

            </div>
        </div>
    </div>
</section>
<script>
    $(function () {
        $('.photo-list img').on('click', function () {
            layer.photos({
                photos: '.photo-list',
                shadeClose: false,
                closeBtn: 2,
                anim: 5
            });
        })
    });
</script>
{/block}

